package com.norma.macaron.service.facade.controller;

import com.norma.macaron.service.common.client.user.UserServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author zhangchaofeng
 * @date 2020/6/3 0003
 * @description
 */
@RestController
public class UserController {

    @Autowired
    UserServiceClient userServiceClient;

    @RequestMapping("/v1.0/facade/sayHello")
    @PreAuthorize("hasAuthority('t_sysmanager_user_view')")
    public Map<String,Object> sayHello(@RequestParam String userName){
        return userServiceClient.sayHello(userName);
    }

}
